<html>
<head>
	<meta charset="UTF-8">
	<title>流程版本历史列表</title>
	<link id="easyuiTheme"  href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/css/esaas-easyui-edit.css" rel="stylesheet" type="text/css"/>
	<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
	<script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
	<script src="../../ffres/dict/all.js" type="text/javascript"></script>
	<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<script type="text/javascript">
	$(function(){
		var bpmCode = $.getUrlParam("bpmCode");
		$('#dg').datagrid({
			queryParams: {
				bpmCode: bpmCode,
				latestState: "N"
			}
		});
		var bpmType = $.getUrlParam("bpmType");
		$('#dg').datagrid({url : '../../api/bpm/base/infos/'+bpmType})
	});

	function doView(){
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			JLEUtil.createModalWin('详情',`BpmBaseInfoView.html?` + '&bpmId=' + row.bpmId);
		} else {
			$.messager.alert('提示','请选择一条记录！','info');
		}
	}

	//查看流程图
	function doViewFlow(){
		var bpmType = $.getUrlParam("bpmType");
		var url = '';
		if(bpmType == '1'){
			url = 'AutoBpmFlowChartView.html';
		}else{
			url = 'WfiBpmFlowChartView.html';
		}
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			JLUtil.linkNewPage(url+'?' + '&bpmId=' + row.bpmId+'&bpmState='+row.bpmState);
			// JLEUtil.createModalWin('详情',url+'?' + '&bpmId=' + row.bpmId+'&bpmState='+row.bpmState);
		} else {
			$.messager.alert('提示','请选择一条记录！','info');
		}
	}

	function reloadList(){
		$('#dg').datagrid('reload');
		JLEUtil.closewin();
	};

	//关闭
	function closeForm() {
		window.parent.JLEUtil.closewin();
	}

</script>
</head>
<body class="easyui-layout">
<div data-options="region:'north',title:''" style="height: 28px; ">
	<div  class="esaas-info-title2" style="background-color: #205081;" >
		<div  style="padding: 2px; ">流程版本历史列表</div>
		<a style="position:absolute;right: 5px;top: 1px;width:22px;height: 22px;background: url('../../static/easyui/themes/icons/cancel6.png')" class="easyui-menubutton" onclick="closeForm()" hr="#"></a>
	</div>
</div>
<div data-options="region:'center',split:false">
	<table id="dg" class="easyui-datagrid" title="" style="width:100%;height:94%"
		   data-options="singleSelect:true,collapsible:true,method:'post'"
		   toolbar="#tb"
		   rownumbers="true" pagination="true" pageSize="20">
		<thead>
		<tr>
			<th data-options="field:'bpmId',resizable:true" hidden="true">流程标识</th>
			<th data-options="field:'bpmCode',resizable:true" >流程编号</th>
			<th data-options="field:'bpmName',resizable:true" >流程名称</th>
			<th data-options="field:'equallyTaskAmount',resizable:true" >任务并发数</th>
			<th data-options="field:'isRunAgain',resizable:true" formatter="formatter_STD_PUB_YN">是否允许重跑</th>
			<th data-options="field:'bpmVersion',resizable:true" >流程版本</th>
			<th data-options="field:'bpmState',resizable:true" formatter="formatter_BPM_STATE">流程状态</th>
			<th data-options="field:'subsCode',resizable:true" hidden="true">子系统代码</th>
			<th data-options="field:'createUser',resizable:true" >创建人</th>
			<th data-options="field:'createTime',resizable:true" >创建时间</th>
			<th data-options="field:'lastUpdateUser',resizable:true" >最后更新人</th>
			<th data-options="field:'lastUpdateTime',resizable:true" >最后修改时间</th>
		</tr>
		</thead>
	</table>
</div>
<div id="tb" style="padding:1px">
	<div style="margin-bottom:2px">
		<a href="javascript:doView()" class="easyui-linkbutton" iconCls="icon-ok" plain="true">查看</a>
		<a href="javascript:doViewFlow()" class="easyui-linkbutton" iconCls="icon-ok" plain="true">查看流程图</a>
	</div>
</div>
</body>
</html>
